﻿#pragma once
#pragma execution_character_set("utf-8")
// 本文件为utf-8 编码格式

#ifndef __GD__GdChatViewController__
#define __GD__GdChatViewController__

#include "CrossApp.h"
#include "../CommonHttpManager.h"

class GdChatViewController :
	public CAViewController
{

public:

	GdChatViewController();

	virtual ~GdChatViewController();

	bool init();
public:
	void onSendBtnClick(CrossApp::CAControl *control, CrossApp::CCPoint point);

public:
	void onPostFinish(const HttpResponseStatus& status, const CSJson::Value& json);
protected:
	void viewDidLoad();
	void viewDidUnload();
	virtual void viewDidAppear();
	virtual void viewDidDisappear();
	void addNewMsg(std::string msg, bool isMe = false);

	void scrollToBtm();
private:
	float curHeight; // 当前内容高度
	CAScrollView *scrollView;
	CAView *sendNode;
	CCSize winSize;
	CATextField *inputField;
};
#endif /* defined(__HelloCpp__ViewController__) */